import notice from "../assets/audio/notice.mp3";

//根据类型返回音频文件
export function getAudioUrlByType(type) {
  let audioUrl;
  if (type == "notice") {
    //肝胆扫查完成
    audioUrl = notice;
  }
  return audioUrl;
}

//px转换为cm
export function px2cm(px) {
  var ratio = 0;
  var div = document.createElement("div");
  div.style.width = "1cm";
  div.id = "puc";
  document.body.appendChild(div);
  var w = getComputedStyle(div, null).width;
  ratio = w.substr(0, w.length - 2);
  div.parentNode.removeChild(div);
  return Math.round((px * 10) / ratio) / 10;
}
//屏幕上两点的距离
export function distance(x, y) {
  if (!x || !y) {
    return 0;
  }
  const dx = Math.abs(x.x - y.x);
  const dy = Math.abs(x.y - y.y);
  const dis = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
  return dis;
}
export const own_columns2 = [
  {
    title: "患者ID",
    dataIndex: "sNo",
    key: "sNo",
    ellipsis: true,
    width: 160,
  },
  {
    title: "姓名",
    dataIndex: "name",
    key: "name",
    ellipsis: true,
    width: 100,
  },
  {
    title: "性别",
    key: "sex",
    dataIndex: "sex",
  },
  {
    title: "检查医院",
    dataIndex: "pat_hospital",
    key: "pat_hospital",
    ellipsis: true,
    width: 180,
  },
  {
    title: "年龄",
    key: "year",
    dataIndex: "year",
    scopedSlots: { customRender: "year" },
    ellipsis: true,
    width: 100,
  },
  {
    title: "检查部位",
    dataIndex: "pos",
    key: "pos",
    ellipsis: true,
    width: 120,
  },
  {
    title: "检查时间",
    dataIndex: "startAt",
    key: "startAt",
    ellipsis: true,
    width: 190,
  },
  {
    title: "图像数量",
    dataIndex: "images",
    key: "images",
    scopedSlots: { customRender: "images" },
  },
  {
    title: "检查模式",
    dataIndex: "model",
    key: "model",
    ellipsis: true,
    width: 120,
  },
  {
    title: "检查状态",
    key: "state",
    dataIndex: "state",
    ellipsis: true,
    width: 140,
  },
  {
    title: "操作",
    key: "action",
    scopedSlots: {
      customRender: "action",
    },
    ellipsis: true,
    width: 160,
  },
];
